<input type="hidden" th:value="#{common.dialog.add}" id="addTitle">
<input type="hidden" th:value="#{common.dialog.edit}" id="editTitle">
<div id="main" class="pd14 vany_authority">
    <div class="vany_treeTable pd14">
        <!--面包屑-->
        <div class="pb10" id="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item :to="{ path: '/' }" th:text="#{breadcrumb.procurement}">Procurement Community</el-breadcrumb-item>
                <el-breadcrumb-item th:text="#{breadcrumb.supplier}">Procurement Community</el-breadcrumb-item>
            </el-breadcrumb>
            <i-favorite></i-favorite>
        </div>
        <div>
            <el-form :inline="true" size="mini">

                <el-form-item th:label="#{ultimate}" label-width="100px">
                    <el-input
                            v-model="search.ultimate"
                            clearable>
                    </el-input>
                </el-form-item>
                <el-form-item th:label="#{vendor}" label-width="100px">
                    <el-input
                            v-model="search.vendor"
                            clearable>
                    </el-input>
                </el-form-item>
                <el-form-item th:label="#{category}" label-width="100px">
                    <el-select v-model="search.categories">
                        <el-option v-for="item in linkCategories" :label="item" :key="item" :value="item"></el-option>
                    </el-select>
                </el-form-item>
            </el-form>
                <el-form :inline="true">
                <el-form-item th:label="#{supplier.type}" label-width="100px">
                    <el-select v-model="search.type">
                        <el-option v-for="item in linkCategories" :label="item" :key="item" :value="item"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item th:label="#{supplier.class}" label-width="100px">
                    <el-select v-model="search.class">
                        <el-option v-for="item in linkCategories" :label="item" :key="item" :value="item"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item th:label="#{plant}" label-width="100px">
                    <el-input
                            v-model="search.plant"
                            clearable>
                    </el-input>
                </el-form-item>
                </el-form>
            <el-form :inline="true">
                <el-form-item th:label="#{ppm}" label-width="100px">
                    <el-input
                            v-model="search.ppm"
                            clearable>
                    </el-input>
                </el-form-item>
                <el-form-item th:label="#{pp}" label-width="100px">
                    <el-input
                            v-model="search.pp"
                            clearable>
                    </el-input>
                </el-form-item>
                <el-form-item th:label="#{csr}" label-width="100px">
                    <el-input
                            v-model="search.csr"
                            clearable>
                    </el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="getData" th:text="#{common.search}">search</el-button>
                </el-form-item>

            </el-form>
            <el-row>
                <el-col>
                    <el-button type="primary" icon="el-icon-plus" @click="upload" th:text="#{common.upload}">Add</el-button>
                    <el-button type="primary" icon="el-icon-share" @click="exportVisible=true" th:text="#{common.export}">Export</el-button>
                </el-col>
            </el-row>
            <el-table :data="tableData" v-loading="listLoading" :height="tableHeight">
                <el-table-column label="" prop="id">
                    <template scope="scope">
                        <img src="templates/img/edit.png" @click="edit(scope.row)"/>
                        <img src="templates/img/delete.png" @click="delete(scope.row)"/>
                    </template>
                </el-table-column>
                <el-table-column th:label="#{common.no}" type="index"></el-table-column>
                <el-table-column th:label="#{duns.table.col2}" prop="ultimateCode"></el-table-column>
                <el-table-column th:label="#{duns.table.col3}" prop="dunsUltimate.ultimateName"></el-table-column>
                <el-table-column th:label="#{duns.table.col4}" prop="elementaryCode"></el-table-column>
                <el-table-column th:label="#{duns.table.col5}" prop="dunsElementary.elementaryName"></el-table-column>
                <el-table-column th:label="#{duns.table.col6}" prop="dunsUltimate.ultimateLinkCategory"></el-table-column>
                <el-table-column th:label="#{duns.table.col7}" prop="dunsElementary.elementaryLinkCategory"></el-table-column>
                <el-table-column th:label="#{common.update.user}" prop="modifyUserName"></el-table-column>
                <el-table-column th:label="#{common.update.date}" prop="modifyTime"></el-table-column>
            </el-table>
            <el-pagination
                    @size-change=""
                    @current-change=""
                    :current-page="search.current"
                    :page-size="search.size"
                    layout="total, prev, pager, next"
                    :total="total">
            </el-pagination>
        </div>
        <el-dialog :title="dialogTitle" :visible.sync="addVisible">
            <el-form :model="form" label-width="200px">
                <el-col :span="12">
                    <el-form-item th:label="#{duns.table.col2}">
                        <el-input v-model="form.ultimateCode"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item th:label="#{duns.table.col3}">
                        <el-input v-model="form.dunsUltimate.ultimateName"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item th:label="#{duns.table.col4}">
                        <el-input
                                v-model="form.elementaryCode">
                        </el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item th:label="#{duns.table.col5}">
                        <el-input
                                v-model="form.dunsElementary.elementaryName">
                        </el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item th:label="#{duns.table.col6}">
                        <el-select v-model="form.dunsUltimate.ultimateLinkCategory" th:placeholder="#{common.hint.select}">
                            <el-option v-for="item in categories" :label="item.code" :value="item.code"
                                       :key="item.code"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item th:label="#{duns.table.col7}">
                        <el-select v-model="form.dunsElementary.elementaryLinkCategory" th:placeholder="#{common.hint.select}">
                            <el-option v-for="item in categories" :label="item.code" :value="item.code"
                                       :key="item.code"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>

            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="submitForm" th:text="#{common.submit}">确 定</el-button>
                <el-button @click="addVisible = false" th:text="#{common.cancel}">取 消</el-button>
            </span>
        </el-dialog>
    </div>
</div>
<script type="text/javascript" src="templates/data/js/supplier.js?t=new Date().getTime()"></script>